package com.ktjy.task;

import com.ktjy.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class WebSocketTask {
    @Autowired
    WebSocketServer webSocketServer;

//    @Scheduled(cron="0/10 * * * * ?")
    public void task() throws IOException {
        System.out.println("服务端给客户端发一个信息：123");
        webSocketServer.send("服务端给客户端发一个信息：123");
    }
}
